package com.example.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.entity.TPurchase;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mapper.TPurchaseMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TPurchaseService extends ServiceImpl<TPurchaseMapper, TPurchase> {

    @Resource
    private TPurchaseMapper tPurchaseMapper;

    public List<TPurchase> getTPurchaseList(String name) {
        QueryWrapper<TPurchase> wrapper = new QueryWrapper<>();
        wrapper.eq("product_name_rel", name);
        return tPurchaseMapper.selectList(wrapper);
    }

}
